package org.interfaceadaptation.parameter.match.impl;

import org.interfaceadaptation.parameter.Parameter;
import org.interfaceadaptation.parameter.match.ExpressionMatcher;

public class StrichNameParameterMatcher implements ExpressionMatcher {

    @Override
    public boolean match(Parameter one, Parameter other) {
        for (String oneParamName : one.getNames()) {
            for (String otherParamName : other.getNames()) {
                if (oneParamName != null && otherParamName != null && oneParamName.equals(otherParamName)) {
                    one.setAssociated(other);
                    other.setAssociated(one);
                    return true;
                }
            }
        }
        return false;
    }

}
